#ifndef app_vars_header
#define app_vars_header

#include <stdint.h>
#include "cJSON.h"
#include <stdbool.h>
#include <stdlib.h>

#define OP_CODE_SUCCESS "success"

#define OP_CODE_BLE_HAS_RUNNING "ble_is_running"

#define OP_CODE_BLE_INIT_ERROR "ble_init_err"

#define OP_CODE_PARA_ERR "para_err"

#define OP_CODE_NOT_JSON_FORMAT "not_json_format"
#define OP_CODE_LACK_COMMAND "lack_command"
#define OP_CODE_OUT_RANGE "out_range"
#define OP_CODE_BUSY "busy"

#define OP_CODE_HID_NOT_INIT "hid_not_init"


typedef struct {
    // int id;
    // char name[32];
    // float value;
    bool hasConnected;
char  * ipAddr;
char * macAddr;
char * nickName;
char * devcCode ;
bool tcpLinked;
bool km;
int time;
} AppGlobalConfig;

// 声明全局变量
extern AppGlobalConfig appConfig;

void initAppConfiguration();
char * getAppConfigJson();
#endif